export default function() {
  const script = document.createElement("script");
  script.src = "http://pv.sohu.com/cityjson?ie=utf-8";
  document.body.appendChild(script);
  return new Promise((resolve, reject) => {
    const timer = setInterval(() => {
      if (window.returnCitySN) {
        resolve(window.returnCitySN.cname);
        window.clearInterval(timer);
        document.body.removeChild(script);
      }
    }, 50);
  });
}
